package com.ruoyi.backend.controller;

import com.ruoyi.backend.domain.dto.SysUserDto;
import com.ruoyi.backend.service.IUserManageService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.page.TableDataInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 用户后端管理Controller
 *
 * @author wjr
 * @date 2025-09-23
 */
@RestController
@RequestMapping("/backend/user_manage")
@Api(tags = "用户后端管理")
public class UserManageController extends BaseController
{
    @Autowired
    private IUserManageService userManageService;

    /**
     * 获取用户列表
     */
    @GetMapping("/selectUserList")
    @ApiOperation("获取用户列表-不分页")
    public AjaxResult selectUserList(SysUserDto sysUserDto)
    {
        List<SysUser> list = userManageService.selectUserList(sysUserDto);
        return success(list);
    }

    /**
     * 获取用户列表
     */
    @GetMapping("/selectUserListPage")
    @ApiOperation("获取用户列表-分页")
    public TableDataInfo selectUserListPage(SysUserDto sysUserDto)
    {
        startPage();
        List<SysUser> list = userManageService.selectUserList(sysUserDto);
        return getDataTable(list);
    }

}
